#!/bin/bash
num=20
ans=1
echo "请输入要计算的阶乘数！"
read num1
num=$num1

while
	[ $num -ge 2 ]
do
	#echo $ans
	#echo $num
	ans=`expr $ans \* $num`
	num=`expr $num - 1` 
done
echo $num1 "的阶乘为："
echo $ans
